<script setup lang="ts">
interface IProps {
  defaultOpen: number;
}

type EmitEvents = {
  (event: 'change', payload: { defaultOpen: number }): void;
};
const props = defineProps<IProps>();
const emits = defineEmits<EmitEvents>();
</script>

<template>
  <van-tabs :active="props.defaultOpen" @change="(e: any) => emits('change', { defaultOpen: e.detail.name })">
    <van-tab title="精选" :name="1" />
    <van-tab title="全部" :name="2" />
  </van-tabs>
</template>
